package com.un.ebs.product.domain;

import java.util.Date;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.un.ebs.product.enums.ProductSkuResourceStatusEnum;
import org.springframework.stereotype.Component;
import lombok.Data;
import com.un.ebs.core.metadata.DbField;

/**
 * (ProductSku)表实体类
 *
 * @author liubo
 * @since 2020-09-13 23:43:40
 */
@Data
@Component
@TableName("tb_product_sku")
@SuppressWarnings("serial")
public class ProductSku extends Model<ProductSku> {

    @TableId(value = "id", type = IdType.UUID)
    private String id;


    @DbField(name = "product_id", length = 40, precision = 0)
    private String productId;

    @DbField(name = "qty", length = 10, precision = 2)
    private Double qty;

    @DbField(name = "price", length = 10, precision = 2)
    private Double price;

    @TableLogic
    @DbField(name = "is_delete", length = -1, precision = 0)
    private Boolean isDelete;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_time", length = -1, precision = 0)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_at", length = 40, precision = 0)
    private String createAt;

    @TableField(fill = FieldFill.UPDATE)
    @DbField(name = "last_modified_time", length = -1, precision = 0)
    private Date lastModifiedTime;

    @TableField(fill = FieldFill.UPDATE)
    @DbField(name = "last_modified_at", length = 40, precision = 0)
    private String lastModifiedAt;

    @DbField(name = "tenant_id", length = 40, precision = 0)
    private String tenantId;

    @DbField(name = "is_sale", length = -1, precision = 0)
    private Boolean isSale;

    @DbField(name = "sku_code", length = 100, precision = 0)
    private String skuCode;

    @DbField(name = "resource_status", length = -1, precision = 0)
    private ProductSkuResourceStatusEnum resourceStatus;

    @DbField(name = "resource_order_item_id", length = 40, precision = 0)
    private String resourceOrderItemId;

    @DbField(name = "is_virtual", length = -1, precision = 0)
    private Boolean isVirtual;

    @DbField(name = "qrcode", length = 40, precision = 0)
    private String qrcode;

    @DbField(name = "is_price_confer", length = -1, precision = 0)
    private Boolean isPriceConfer;

    @DbField(name = "production_seq_id", length = 40, precision = 0)
    private String productionSeqId;

    @DbField(name = "cost_price", length = 18, precision = 4)
    private Double costPrice;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}